home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12667 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.6 KB

  1. Path: news.its.com!usenet
  2. From: mastbrook@duff.com (Bill Mastbrook)
  3. Newsgroups: comp.lang.basic.visual.misc,comp.lang.c,comp.os.ms-windows.programmer.controls
  4. Subject: Re: VBX instances - HCTL values
  5. Date: Mon, 01 Apr 1996 18:34:11 GMT
  6. Organization: Information Technology Solutions, Inc.
  7. Message-ID: <4jp844$8jn@news.its.com>
  8. References: <4iv5pk$j2q@news.its.com> <4j5p85$qv9@zebedee.ingres.co.uk>
  9. NNTP-Posting-Host: duff230.duff.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. > mastbrook@duff.com (Bill Mastbrook) wrote:
  13.  
  14. >>Each instance of a VBX that I've created seems to be generating the
  15. >>same value for HCTL.
  16.  
  17. jonm@ingres.com (Jon Machtynger) wrote:
  18.  
  19. >To convince you that it should all work.  Take a look at the circ2
  20. >or circ3 examples that come with VB3.0 Proffessional edition.
  21.  
  22. >In the FireClickIn reoutine, add the following code.
  23.  
  24. >char Msg[100];
  25.  
  26. >wsprintf(Msg, "HTCL = %d", hctl);
  27. >MessageBox(NULL, Msg, NULL, MB_OK);
  28.  
  29. >Now creae two circ2 controls.  When you click on each one, it
  30. >should show a different value.
  31.  
  32. I did exactly this and the same problem still exists: The HCTL value
  33. returned from clicking in any instance of the circ2.vbx is 242.  This
  34. is exactly the same value for hctl that I always see from any VBX
  35. (242).
  36.  
  37. Here's exactly what I did ...
  38.  
  39. Added the above code to the beginning of FireClickIn in circ2.c.
  40. Made a new VBX project using VC++ 1.52.
  41. Added files circ2.c, circ2.def, circ2.rc to the project.
  42. Added vbapi to the list of linked libraries.
  43. Built the VBX.
  44. Created a new VB 3.0 exe containing one form with the circ2.vbx on it.
  45. (No code, whatsoever).
  46. Copied the VBX to my system directory.
  47. Ran multiple instances of this exe.
  48. All clicks generated "HCTL = 242".
  49.  
  50. I did receive the following warnings when buildiing the VBX:
  51.     Binding resources...
  52.     RC: warning RW4002: Non-discardable segment 1 set to PRELOAD
  53.     RC: warning RW4002: Non-discardable segment 2 set to PRELOAD
  54. I ignored them.
  55.  
  56. Any ideas?  Could this possibly be a problem with my machine, my
  57. compiler, my compile setttings, or something similar, because from
  58. this test using circ2.vbx I would tend to think that there isn't
  59. anything wrong with my code.
  60.  
  61.  
  62. I just realized that when you said, "Now creae two circ2 controls",
  63. that you may have meant to create two different .vbx files using the
  64. same code.  Is this correct?  If so, does this mean that any instance
  65. of a particular VBX (i.e. .vbx file included in a VB project and the
  66. vbx control placed on a form) passes the same HCTL value to the main
  67. procedure of the VBX.  If this is true, then I'm back to my original
  68. question, "How do you fire events in the correct one?".
  69.  
  70.  
  71. Thanks,
  72. Bill
  73.  
  74.  
  75.  
  76.